package com.woniu.internalcommon.remote;


import com.woniu.internalcommon.dto.ApiBossOrder;
import com.woniu.internalcommon.dto.OrderInfo;
import com.woniu.internalcommon.dto.ResponseResult;
import com.woniu.internalcommon.request.DriverGrabRequest;
import com.woniu.internalcommon.request.OrderRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "service-order" ,path = "service-order")
public interface ServiceOrderClient {

    /**
     * 接乘客
     * @param orderRequest
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/order/to-pick-up-passenger")
    public ResponseResult toPickUpPassenger(@RequestBody OrderRequest orderRequest);

    /**
     * 到达目的地
     * @param orderRequest
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/order/arrived-departure")
    public ResponseResult arrivedDeparture(@RequestBody OrderRequest orderRequest);

    /**
     * 确认接到乘客
     * @param orderRequest
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/order/pick-up-passenger")
    public ResponseResult pickUpPassenger(@RequestBody OrderRequest orderRequest);

    /**
     * 乘客下车
     * @param orderRequest
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value ="/order/passenger-getoff")
    public ResponseResult passengerGetoff(@RequestBody OrderRequest orderRequest);

    /**
     * 订单取消
     * @param orderId
     * @param identity
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/order/cancel")
    public ResponseResult cancel(@RequestParam("orderId") Long orderId, @RequestParam("identity") String identity);

    /**
     * 订单支付
     * @param orderRequest
     * @return
     */
    @PostMapping("/order/push-pay-info")
    public ResponseResult pushPayInfo(@RequestBody OrderRequest orderRequest);

    @RequestMapping(method = RequestMethod.GET, value = "/order/detail")
    public ResponseResult<OrderInfo> detail(@RequestParam("orderId") Long orderId);

    /**
     * 获取订单列表
     * @param phone
     * @param identity
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/order/current")
    public ResponseResult current(@RequestParam("phone") String phone ,@RequestParam("identity") String identity);

    /**
     * 司机抢单
     * @param driverGrabRequest
     * @return
     */
    @PostMapping(value = "/order/grab"  )
    public ResponseResult driverGrab(@RequestBody DriverGrabRequest driverGrabRequest);

    /**
     * 添加订单
     * @param orderRequest
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/order/add")
    public ResponseResult add(@RequestBody OrderRequest orderRequest);

    /**
     * 预约订单
     * @param orderRequest
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/order/book")
    public ResponseResult book(@RequestBody OrderRequest orderRequest);

    @RequestMapping(method = RequestMethod.GET,value = "/test-real-time-order/{orderId}")
    public String dispatchRealTimeOrder(@PathVariable("orderId") long orderId);


    @RequestMapping(method = RequestMethod.POST, value = "/order/pay")
    public ResponseResult pay(@RequestBody OrderRequest orderRequest);

    /**
     * 多条件，分页查询订单
     * @param apiBossOrder
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = "/order/select")
    public ResponseResult select(@RequestBody ApiBossOrder apiBossOrder);

}